/* CS32 FINAL PROJECT */

package Objects;

import GameEngine.*;
import GameEngine.GameConstants.Graphic;
import GameEngine.GameConstants.Modifier;

/**
 * This class represents an object as it will be sent to the GUI for purpose of rendering.
 * It does not include physical properties of the object that are not relevant to graphically
 * rendering it.
 * @author mhfowler
 */
public class BasicObject {

    /* this boolean says whether the object exists in the level or not...used for letting graphics
     * know to delete an object */
      /* additionally, there will be a list of objects in a level, and if destroyed an object will remove
     * itself from this list, but there may still be a reference to an object in a group
     * that it was a part of, and thus to avoid a group effect trying to act on an object
     * that is no longer there we keep track of this boolean and set it to false when an
     * object is destroy */
    boolean exists;

    /* this enumeration will correspond with the graphical representation of this object */
    protected Graphic graph;

    /* direction object is facing */
    protected Vector direction;

    /* unique identifier */
    protected short id;

    protected Vector center, size; // center and size of this BasicObject

    public BasicObject(Vector dir, Vector cen, Vector s, Graphic g) {
        direction = new Vector(dir);
        center = new Vector(cen);
        size = new Vector(s);
        graph = g;
        exists = true;
    }

    public BasicObject()
    {

    }

    /**
     * Moves this object
     * @param move
     */
    public void move(Vector move) {
        center.add(move);
    }

    public Vector getCenter() {
        return center;
    }

    public void setCenter(Vector center) {
        this.center = center;
    }

    public Vector getSize() {
        return size;
    }

    public void setSize(Vector size) {
        this.size = size;
    }

    public Graphic getGraph() {
        return graph;
    }

    public short getId() {
        return id;
    }

      /* SETTTERS */

    public void setGraph(Graphic graph) {
        this.graph = graph;
    }

    public void setId(short id) {
        this.id = id;
    }

    public void setDir(Vector d) {
        direction = d;
    }

    public Vector getDir() {
        return direction;
    }

    public boolean isExists() {
        return exists;
    }

    public void setExists(boolean exists) {
        this.exists = exists;
    }



}
